package com.blb.zycommunity.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
@TableName("sys_user")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ColumnWidth(25)                                //列宽
@HeadFontStyle(fontHeightInPoints = 20)         //标题行高
@ContentFontStyle(fontHeightInPoints = 12)      //内容行高
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, fillBackgroundColor = -1)
@ApiModel(value = "SysUser对象", description = "用户信息表")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty("用户编号")
    @ApiModelProperty("用户ID")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    @ExcelIgnore
    @ApiModelProperty("部门ID")
    private Long deptId;

    @ExcelProperty("用户名称")
    @ApiModelProperty("用户账号")
    private String userName;

    @ExcelProperty("用户昵称")
    @ApiModelProperty("用户昵称")
    private String nickName;

    @ExcelIgnore
    @ApiModelProperty("用户类型（00系统用户）")
    private String userType;

    @ExcelIgnore
    @ApiModelProperty("用户邮箱")
    private String email;

    @ExcelProperty("手机号码")
    @ApiModelProperty("手机号码")
    private String phonenumber;

    @ExcelIgnore
    @ApiModelProperty("用户性别（0男 1女 2未知）")
    private String sex;

    @ExcelIgnore
    @ApiModelProperty("头像地址")
    private String avatar;

    @ExcelIgnore
    @ApiModelProperty("密码")
    private String password;

    @ExcelProperty("帐号状态（0正常 1停用）")
    @ApiModelProperty("帐号状态（0正常 1停用）")
    private String status;

    @ExcelIgnore
    @ApiModelProperty("删除标志（0代表存在 2代表删除）")
    private String delFlag;

    @ExcelIgnore
    @ApiModelProperty("最后登录IP")
    private String loginIp;

    @ExcelIgnore
    @ApiModelProperty("最后登录时间")
    private LocalDateTime loginDate;

    @ExcelIgnore
    @ApiModelProperty("创建者")
    private String createBy;

    @ExcelProperty("创建时间")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ExcelIgnore
    @ApiModelProperty("更新者")
    private String updateBy;

    @ExcelIgnore
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ExcelIgnore
    @ApiModelProperty("备注")
    private String remark;

    @ExcelProperty("部门名称")
    @ApiModelProperty("部门名称")
    @TableField(exist = false)
    private String deptName;

    @ExcelIgnore
    @ApiModelProperty("职位名称")
    @TableField(exist = false)
    private String postName;

    @ExcelIgnore
    @ApiModelProperty("角色名称")
    @TableField(exist = false)
    private String roleName;

    @ExcelIgnore
    @TableField(exist = false)
    private SysDept sysDept;

    //用户对象
    @ExcelIgnore
    @TableField(exist = false)
    private SysUser sysUser;

    @ExcelIgnore
    @TableField(exist = false)
    private List<SysPost> sysPosts;

    @ExcelIgnore
    @TableField(exist = false)
    private List<SysRole> sysRoles;

}
